class DeviceOrientation {
    constructor() {
        this.init();
        this.rotate = {};
    }
    init() {
        let container1 = document.querySelector('.container1');
        if (this.isDeviceOrientationEventSupported()) {
            window.addEventListener('deviceorientation', (event) => {
                container1.innerHTML = `orientation:<br>alpha:${event.alpha}<br> beta:${event.beta}<br> gamma:${event.gamma}`
            });
        } else {
            alert('deviceorientation event not supported');
        }

    }
    isDeviceOrientationEventSupported() {
        if (window.DeviceOrientationEvent) {
            return true;
        }
        return false;
    }
}
module.exports = DeviceOrientation;
